#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 
#include <math.h> 
#include <ctype.h> 
#include <time.h> 
#include <assert.h>

#define n 10000
int la, lb, lc;

int cmp(char* x, char* y)
{
	int len_x = strlen(x);
	int len_y = strlen(y);

	if (len_x != len_y)
		return len_x < len_y;
	else
		return strcmp(x, y) < 0;
}

void sub(int* a, int* b, int* c)
{
	for (int i = 0; i < lc; i++)
	{
		c[i] = a[i] - b[i];
		if (c[i] < 0)
		{
			a[i + 1]--;
			c[i] += 10;
		}
	}
	while (lc > 1 && c[lc - 1] == 0)
		lc--;
}

int main()
{
	char x[n], y[n];
	scanf("%s %s", x, y);

	int flag = 0;
	if (cmp(x, y))
	{
		char tmp[n];
		strcpy(tmp, x);
		strcpy(x, y);
		strcpy(y, tmp);
		flag = 1;
	}

	la = strlen(x);
	lb = strlen(y);
	lc = la > lb ? la : lb;
	int* a = (int*)calloc(n, sizeof(int));
	int* b = (int*)calloc(n, sizeof(int));
	int* c = (int*)calloc(n, sizeof(int));

	for (int i = 0; i < la; i++)
		a[la - 1 - i] = x[i] - '0';
	for (int i = 0; i < lb; i++)
		b[lb - 1 - i] = y[i] - '0';

	sub(a, b, c);

	if (flag)
		printf("-");

	for (int i = lc - 1; i >= 0; i--)
		printf("%d", c[i]);

	printf("\n");

	return 0;
}
